<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
    <head>
        <meta charset="UTF-8">
        <title></title>
    </head>
    <body>
        <?php
for($q=1;$q<$gaodu;$q++){  
      
    for($w=0;$w<$q;$w++){ //先算出空格  
        echo " ";  
    }  
      
    for($w=($gaodu-$q)*2-1;$w>0;$w--){  
        if($q==$gaodu-1){ //判断最后一行星号  
            echo "*";  
        }else{  
            if($w==1 || $w==($gaodu-$q)*2-1){ //判断第一个星号 或者 最后一个星号  
                echo "*";  
            }else{  
                echo " ";  
            }  
        }  
          
    }  
  
echo "<br>";  
}  
        ?>
    </body>
</html>
